<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>订单提交成功 - 万万书城</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            margin: 0;
            padding: 0;
            background-color: #f5f5f5;
        }
        .header {
            background-color: #4CAF50;
            color: white;
            padding: 15px 0;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        }
        .header-container {
            max-width: 1200px;
            margin: 0 auto;
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0 20px;
        }
        .logo {
            font-size: 24px;
            font-weight: bold;
        }
        .nav a {
            color: white;
            text-decoration: none;
            margin: 0 15px;
        }
        .nav a:hover {
            text-decoration: underline;
        }
        .content {
            max-width: 1200px;
            margin: 20px auto;
            padding: 0 20px;
        }
        .success-container {
            background-color: white;
            border-radius: 8px;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
            padding: 40px;
            text-align: center;
        }
        .success-icon {
            font-size: 80px;
            color: #4CAF50;
            margin-bottom: 20px;
        }
        h2 {
            color: #333;
            margin-bottom: 15px;
        }
        .success-message {
            color: #666;
            margin-bottom: 30px;
            font-size: 16px;
        }
        .order-info {
            background-color: #f9f9f9;
            border-radius: 8px;
            padding: 20px;
            margin: 30px 0;
            display: inline-block;
            text-align: left;
        }
        .info-item {
            margin-bottom: 10px;
        }
        .btn {
            padding: 12px 24px;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            font-size: 16px;
            text-decoration: none;
            margin: 0 10px;
        }
        .btn-primary {
            background-color: #4CAF50;
            color: white;
        }
        .btn-primary:hover {
            background-color: #45a049;
        }
        .btn-secondary {
            background-color: #f0f0f0;
            color: #333;
        }
        .btn-secondary:hover {
            background-color: #e0e0e0;
        }
        .user-info {
            color: white;
        }
        .user-info a {
            color: white;
            margin-left: 10px;
        }
    </style>
</head>
<body>
    <div class="header">
        <div class="header-container">
            <div class="logo">万万书城</div>
            <div class="nav">
                <a href="index.jsp">首页</a>
                <a href="cart">购物车</a>
                <a href="order?action=list">我的订单</a>
                <a href="userCenter">用户中心</a>
            </div>
            <div class="user-info">
                <% if (session.getAttribute("user") != null) {
                    com.wanwanbookstore.entity.User user = (com.wanwanbookstore.entity.User) session.getAttribute("user");
                    out.println(user.getUsername() + " <a href='logout'>退出</a>");
                } else {
                    out.println("<a href='login.jsp'>登录</a> <a href='register.jsp'>注册</a>");
                }
                %>
            </div>
        </div>
    </div>

    <div class="content">
        <div class="success-container">
            <div class="success-icon">✓</div>
            <h2>订单提交成功！</h2>
            <p class="success-message">您的订单已成功提交，我们将尽快为您处理。</p>
            
            <div class="order-info">
                <div class="info-item"><strong>订单号：</strong>${orderId}</div>
                <div class="info-item"><strong>总金额：</strong>¥${totalPrice}</div>
                <div class="info-item"><strong>下单时间：</strong><%= new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new java.util.Date()) %></div>
            </div>
            
            <div>
                <a href="order?action=list" class="btn btn-primary">查看订单</a>
                <a href="index.jsp" class="btn btn-secondary">继续购物</a>
            </div>
        </div>
    </div>
</body>
</html>